package com.mt.yanyou.utils;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * 2020.9.3
 * 封装SharedPreferences
 */
public class SharedPreferencesUtil {
    public static final String FIRST_OPEN = "first_open";
    private  static  final  String spFileName="welcomePage";
    public static  Boolean getBoolean(Context context ,String strKey,Boolean strDefault){
        SharedPreferences sharedPreferences = context.getSharedPreferences(spFileName,Context.MODE_PRIVATE);
        Boolean result = sharedPreferences.getBoolean(strKey,strDefault);
        return result;
    }
    public static  void putBoolean(Context context,String strKey,Boolean strData){
        SharedPreferences sharedPreferences = context.getSharedPreferences(spFileName,Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putBoolean(strKey,strData);
        editor.commit();
    }
}
